package com.hyf.config;

import com.hyf.contant.ReturnCode;
import com.hyf.entity.R;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class BaseExceptionHandler {
    @ExceptionHandler(value = Exception.class)
    @ResponseBody
    public Object error(){
        return new R<>(ReturnCode.ERROR,"服务器错误，请稍后再试",null);
    }
}
